import type { RouterType } from '@/libs/TransitionRouterView/types';
import { isMobileTerminal } from '@/utils';
import { defineStore } from 'pinia';
import { computed, ref } from 'vue';

export default defineStore('router', () => {
  const routerType = ref<RouterType>('none');
  const routerTypeGetter = computed(() => {
    if (isMobileTerminal.value) {
      return routerType.value;
    } else {
      return 'none';
    }
  });

  const changeRouterType = (newRouterType: RouterType) => {
    routerType.value = newRouterType;
  };

  return {
    // routerType,
    routerTypeGetter,
    changeRouterType
  };
});
